package com.zqj.project.util;

import com.zqj.project.common.exception.BizException;

import java.util.Objects;

/**
 * @Description: Validator
 * @Author: 22001010704 Zhang Qijian
 * @CreateTime: 2024/11/8 15:53
 * @Version: 1.0
 */
public class Validator {

    private Validator() {
        throw new IllegalStateException("Utility Class");
    }

    public static <T extends Comparable<T>> void priceValidation(T start, T end) {
        if (Objects.nonNull(start) && Objects.nonNull(end) && start.compareTo(end) > 0) {
            throw new BizException("最低价需小于最高价");
        }
    }

}